#ifndef MESH_H
#define MESH_H

#include <QVector>
#include <QVector3D>
#include <QOpenGLFunctions>
#include <QOpenGLBuffer>
#include <QOpenGLVertexArrayObject>
#include <QOpenGLShaderProgram>

struct Vertex {
    QVector3D position;
    QVector3D normal;
};

class Mesh : protected QOpenGLFunctions
{
public:
    Mesh();
    ~Mesh();

    bool loadFromFile(const QString& filename);
    void render(QOpenGLShaderProgram* program);

    QVector<Vertex> vertices;
    QVector<unsigned int> indices;

private:
    QOpenGLBuffer vbo;
    QOpenGLBuffer ebo;
    QOpenGLVertexArrayObject vao;
    void setupMesh();
};

#endif // MESH_H 